// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV
}) // 使用当前云环境

const db = cloud.database()


exports.main = async (event, context) => {
  try {
    const result = await cloud.callFunction({
      name: 'sendOutGoods',
      data: {},
      trigger: {
        type: 'timer',
        config: {
          cron: '0 0 */4 * * *',
        },
      },
    });
    console.log('定时任务触发，',result);
  } catch (err) {
    console.log(err);
  }
};